package edu.tcc.data.dao.factory;

import edu.tcc.data.Database;
import edu.tcc.data.dao.ConsumerDao;
import edu.tcc.data.dao.FoodDao;

/**
 * The DaoFactory implements the Singleton Design Pattern, and is
 * responsible for instantiating all types of Data Access Objects.
 * 
 * @author Itikawa
 */
public class DaoFactory {
	
	private static final DaoFactory INSTANCE = new DaoFactory();
	
	// private Connection connection;
	private Database database;

	private DaoFactory() {
		database = new Database();
	}
	
	public static DaoFactory getInstance() {
		return INSTANCE;
	}
	
	public ConsumerDao createConsumerDao() {
		return new ConsumerDao(database);
	}
	
	public FoodDao createFoodDao() {
		return new FoodDao(database);
	}
}